package student;

interface MyInterface {
    void test();
}

class Aaa implements MyInterface{

    @Override
    public void test() {
        System.out.println("aaa--test");
    }
}

public class Test02 {
    public static void main(String[] args) {
        MyInterface myInterface = new Aaa();
        myInterface.test();

//        new MyInterface();
        MyInterface myInterface1=new MyInterface() {
            @Override
            public void test() {
                System.out.println("实现接口的test111");
            }
        };
        myInterface1.test();

        new MyInterface() {
            @Override
            public void test() {
                System.out.println("实现接口的test222");
            }
        }.test();
    }
}
